/** DEFAULTNAMES
 *  OLMAP 方法函数
 *  feature操作方法 
 *  @author Goog2023
 */
import {
	isFun
} from './fCommon.js'
import {
	fcreatePoint
} from './fGeom.js'
// 创建一个要素
function fCreateFeature(configs = {}, callback) {
	const feature = new ol.Feature(configs);
	return isFun(callback) ? callback(feature) : feature;
}

// 创建一个点要素
function fCreatePointFeature(coordinate = [0, 0], configs = {}, callback) {
	const feature = fCreateFeature({
		geometry: fcreatePoint(coordinate),
		...configs
	});
	return isFun(callback) ? callback(feature) : feature;
}

export {
	fCreateFeature,
	fCreatePointFeature
}